﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using LPV_POS.Module;

namespace LPV_POS.mh_pos
{
    public partial class mh_chu : DevExpress.XtraEditors.XtraForm
    {
        private string str_uni="";
        private Int16  int_shift = 0;
        public mh_chu()
        {
            InitializeComponent();
        }
        public mh_chu(int x, int y)
        {
            InitializeComponent();
            this.Location = new System.Drawing.Point(x,y);
        }
        
        private void mh_chu_Load(object sender, EventArgs e)
        {
            this.ControlBox = false;
            CancelButton = bton_esc;
            //txt_ketqua.Text = "";
       
            //if (Variable.int_vitri == 1)    // bton dinh muc toi thieu _ mh_quanlykho
            //    this.Location = new System.Drawing.Point(200, 170);
            //if (Variable.str_position_frmchu == "bton_timmahh")
            //    this.Location = new System.Drawing.Point(200, 140);
            //if (Variable.str_position_frmso == "mh_doidvt_bton_slcanquydoi")
            //    this.Location = new System.Drawing.Point(750, 140);
            //if (Variable.str_position_frmchu == "bton_tendonvitinh")
            //    this.Location = new System.Drawing.Point(300,250);
            //if (Variable.str_position_frmchu == "mhdmkhohang_bton_tenkho")
            //    this.Location = new System.Drawing.Point(140, 300);
            //if (Variable.str_position_frmchu == "mhdmnhomhhc_bton_tennhomhh")
            //    this.Location = new System.Drawing.Point(250, 200);

            //if (Variable.str_position_frmchu == "mh_khachhang")
            //    this.Location = new System.Drawing.Point(300, 200);

            //if (Variable.str_position_frmchu == "mh_dmtiente")
            //    this.Location = new System.Drawing.Point(300, 200);
          
            //else if (Variable.int_vitri == 2)   // bton nhap kho _ mh_quanlykho
            //    this.Location = new System.Drawing.Point(800, 360);
            //else if (Variable.int_vitri == 3)   // bton nhap kho _ mh_quanlykho
            //    this.Location = new System.Drawing.Point(850, 360);
            txt_ketqua.Text = Variable.str_position_frmchu;
             this.Location = new System.Drawing.Point(Variable.pont_x, Variable.pont_y);
            Variable.pont_x = 0;
            Variable.pont_y = 0;
            this.StartPosition = FormStartPosition.CenterScreen;
            
            Variable.int_vitri = 0;
            Variable.str_position_frmchu = "";
            Variable.str_position_frmso = "";
            str_uni = txt_ketqua.Text;
        }

        #region "   btn_0-->9"
        private void bton_1_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_1.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length -1,1))
            {
                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Á";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Á":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "á";
                    txt_ketqua.Text = str_uni;
                    break;
                case "á":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ấ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ấ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ấ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ấ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â1";
                    txt_ketqua.Text = str_uni;
                    break;


                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ắ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ắ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ắ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ắ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă1";
                    txt_ketqua.Text = str_uni;
                    break;

                case  "O" :
                    str_uni = str_uni.Substring(0, str_uni.Length -1)+ "Ó";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ó":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ó";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ó":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ớ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ớ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ớ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ớ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ố";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ố":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ố";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ố":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "E":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "É";
                    txt_ketqua.Text = str_uni;
                    break;

                case "É":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "E1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "e":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "é";
                    txt_ketqua.Text = str_uni;
                    break;
                case "é":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "e1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ế";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ế":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ê1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ế";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ế":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ê1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "U":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ú";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ú":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "U1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "u":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ú";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ú":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "u1";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ư":
                    str_uni = str_uni.Substring(0, str_uni.Length -1)+ "Ứ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ứ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ư1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ứ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ứ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ư1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "I":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Í";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Í":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "I1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "i":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "í";
                    txt_ketqua.Text = str_uni;
                    break;
                case "í":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "i1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ý";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ý":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Y1";
                    txt_ketqua.Text = str_uni;
                    break;
                case "y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ý";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ý":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "y1";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_1.Text;
                    txt_ketqua.Text = str_uni;
                    break;
               
            }
        }
        
        private void bton_2_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_2.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "À";
                    txt_ketqua.Text = str_uni;
                    break;
                case "À":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "à";
                    txt_ketqua.Text = str_uni;
                    break;
                case "à":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ầ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ầ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ầ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ầ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ằ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ắ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ằ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ằ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "O":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ò";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ò":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ò";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ò":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ớ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ờ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "Ờ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ờ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ờ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ồ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ồ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ồ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ồ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "E":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "È";
                    txt_ketqua.Text = str_uni;
                    break;
                case "È":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "E2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "e":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "è";
                    txt_ketqua.Text = str_uni;
                    break;
                case "è":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "e2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ề";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ề":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ê2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ề";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ề":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ê2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "U":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ù";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ù":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "U2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "u":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ù";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ù":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "u2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ừ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ừ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ư2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ừ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ừ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ư2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "I":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ì";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ì":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "I2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "i":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ì";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ì":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "i2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỳ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ỳ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Y2";
                    txt_ketqua.Text = str_uni;
                    break;
                case "y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỳ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỳ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "y2";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_2.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }
               
        }

        private void bton_3_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_3.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ả";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ả":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ả";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ả":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẩ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẩ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẩ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẩ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẳ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẳ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẳ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẳ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "O":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỏ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ỏ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỏ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỏ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ở";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ở":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ở";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ở":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ổ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ổ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ổ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ổ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "E":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẻ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẻ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "E3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "e":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẻ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẻ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "e3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ể";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ể":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ê3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ể";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ể":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ê3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "U":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ủ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ủ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "U3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "u":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ủ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ủ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "u3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ử";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ử":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ư3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ử";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ử":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ư3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "I":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỉ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ỉ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "I3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "i":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỉ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỉ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "i3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỷ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ỷ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Y3";
                    txt_ketqua.Text = str_uni;
                    break;
                case "y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỷ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỷ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "y3";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_3.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }
                
        }

        private void bton_4_Click(object sender, EventArgs e)
        {

            if (str_uni.Length == 0)
            {
                str_uni += bton_4.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ã";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ã":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ã";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ã":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẫ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẫ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẫ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẫ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẵ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẵ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẵ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẵ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "O":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Õ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Õ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "õ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "õ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỡ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ỡ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỡ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỡ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỗ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ỗ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỗ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỗ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "E":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẽ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẽ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "E4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "e":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẽ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẽ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "e4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ễ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ễ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ê4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ễ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ễ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ê4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "U":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ũ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ũ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "U4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "u":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ũ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ũ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "u4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ữ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ữ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ư4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ữ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ữ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ư4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "I":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ĩ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ĩ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "I4";
                    txt_ketqua.Text = str_uni;
                    break;
                
                case "i":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ĩ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ĩ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "i4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỹ";
                    txt_ketqua.Text = str_uni;
                    break;
                     case "Ỹ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Y4";
                    txt_ketqua.Text = str_uni;
                    break;
                case "y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỹ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỹ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "y4";
                    txt_ketqua.Text = str_uni;
                    break;
                default :
                    str_uni += bton_4.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }

        }

        private void bton_5_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_5.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {

                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ạ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ạ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ạ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ạ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ậ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ậ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ậ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ậ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ặ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ặ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ặ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ặ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "O":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ọ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ọ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O5";
                    txt_ketqua.Text = str_uni;
                    break;
               
                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ọ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ọ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ợ";
                    txt_ketqua.Text = str_uni;
                    break;
                
                case "Ợ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ợ";
                    txt_ketqua.Text = str_uni;
                    break;

                case "ợ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ộ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ộ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ộ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ộ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "E":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẹ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẹ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "E5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "e":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẹ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẹ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "e5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ệ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ệ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ê5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ệ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ệ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ê5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "U":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ụ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ụ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "U5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "u":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ụ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ụ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "u5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ự";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ự":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ư5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ự";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ự":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ư5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "I":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ị";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ị":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "I5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "i":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ị";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ị":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "i5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ỵ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ỵ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Y5";
                    txt_ketqua.Text = str_uni;
                    break;
                case "y":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ỵ";
                    txt_ketqua.Text = str_uni;
                    break;
              
                default:
                    str_uni += bton_5.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }

        }

        private void bton_6_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_6.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â";
                    txt_ketqua.Text = str_uni;
                    break;
                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Â";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "â";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ạ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ậ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ậ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ạ6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ạ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ậ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ậ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ạ6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "O":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O6";
                    txt_ketqua.Text = str_uni;
                    break;
              
                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o6";
                    txt_ketqua.Text = str_uni;
                    break;
             
                case "Ọ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ộ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ộ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ọ6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ọ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ộ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ộ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ọ6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ô";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ô";
                    txt_ketqua.Text = str_uni;
                    break;

                case "E":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ê";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "E6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "e":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ê";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ê":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "e6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ẹ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ệ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ệ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ẹ6";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ẹ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ệ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ệ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ẹ6";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_6.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }

        }

        private void bton_7_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_7.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
            
                case "O":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "O7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "o":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ơ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "o7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ọ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ợ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ợ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ọ7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ọ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ợ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ợ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ọ7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ơ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ô":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ơ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "U":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ư";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "U7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "u":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ư";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ư":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "u7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ụ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ự";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ự":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ụ7";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ụ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ự";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ự":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ụ7";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_7.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }

        }
        
        private void bton_8_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_8.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
                case "A":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "A8";
                    txt_ketqua.Text = str_uni;
                    break;
                case "a":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă";
                    txt_ketqua.Text = str_uni;
                    break;
                case "ă":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "a8";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Ă";
                    txt_ketqua.Text = str_uni;
                    break;
                
                case "â":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "ă";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_8.Text;
                    txt_ketqua.Text = str_uni;
                    break;
                
            }

        }

        private void bton_9_Click(object sender, EventArgs e)
        {
            if (str_uni.Length == 0)
            {
                str_uni += bton_9.Text;
                txt_ketqua.Text += str_uni;
                return;
            }
            switch (str_uni.Substring(str_uni.Length - 1, 1))
            {
                case "D":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "Đ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "Đ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "D9";
                    txt_ketqua.Text = str_uni;
                    break;
                case "d":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "đ";
                    txt_ketqua.Text = str_uni;
                    break;
                case "đ":
                    str_uni = str_uni.Substring(0, str_uni.Length - 1) + "d9";
                    txt_ketqua.Text = str_uni;
                    break;
                default:
                    str_uni += bton_9.Text;
                    txt_ketqua.Text = str_uni;
                    break;
            }
        }
                
        private void bton_0_Click(object sender, EventArgs e)
        {
            str_uni += bton_0.Text;
            txt_ketqua.Text = str_uni;
        }
        #endregion

        #region "   btn_char"
        private void bton_q_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_q.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_q.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_w_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_w.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_w.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_e_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_e.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_e.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_r_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_r.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_r.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_t_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_t.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_t.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_y_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_y.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_y.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_u_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_u.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_u.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_i_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_i.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_i.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_o_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_o.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_o.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_p_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_p.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_p.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
          
        }

        private void bton_a_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_a.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_a.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
         
        }
        private void bton_s_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_s.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_s.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }

        }

        private void bton_d_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_d.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_d.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_f_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_f.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_f.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_g_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_g.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_g.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_h_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_h.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_h.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_j_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_j.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_j.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_k_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_k.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_k.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
            
        }

        private void bton_l_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_l.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_l.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_z_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_z.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_z.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_x_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_x.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_x.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_c_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_c.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_c.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_v_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_v.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_v.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_b_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_b.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_b.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_n_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_n.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_n.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_m_Click(object sender, EventArgs e)
        {
            if (int_shift == 1)
            {
                str_uni += bton_m.Text;
                txt_ketqua.Text = str_uni;
            }
            else if (int_shift == 0)
            {
                str_uni += bton_m.Text.ToLower();
                txt_ketqua.Text = str_uni;
            }
        }
        #endregion

        #region "   btn_fnc"
        private void bton_enter_Click(object sender, EventArgs e)
        {
            str_uni = "";

            //if (txt_ketqua.Text != "")
                Variable.str_chu = txt_ketqua.Text;
            //else
            //{
            //    Mod_messagebox mess = new Mod_messagebox();
            //    mess.messagebox_pos("Thông báo", "Vui lòng nhập thông tin", loaithongbao.canhbao.GetHashCode());
            //    return;
            //}
                this.DialogResult = DialogResult.OK;
            this.Close();

         
        }

        private void bton_space_Click(object sender, EventArgs e)
        {
            str_uni += " ";
            txt_ketqua.Text = str_uni;
        }

        private void bton_xoa_Click(object sender, EventArgs e)
        {
            if (str_uni != "")
            {
                str_uni = str_uni.Substring(0, str_uni.Length - 1);
                txt_ketqua.Text = str_uni;
            }
        }

        private void bton_esc_Click(object sender, EventArgs e)
        {
            str_uni = "";
            Variable.str_chu = "";
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void bton_point_Click(object sender, EventArgs e)
        {
            str_uni += bton_point.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_twopoints_Click(object sender, EventArgs e)
        {
            str_uni += bton_twopoints.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_shift_Click(object sender, EventArgs e)
        {
            if (int_shift == 0)
            {
                int_shift = 1;
                bton_shift.ForeColor = System.Drawing.Color.Red;
                bton_shift.LookAndFeel.UseDefaultLookAndFeel = false;
                bton_shift.LookAndFeel.SkinName = "Caramel";
                bton_shift.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
                
            }
            else
            {
                int_shift = 0;
                bton_shift.ForeColor = System.Drawing.Color.FromArgb(16, 37, 127);
                bton_shift.LookAndFeel.UseDefaultLookAndFeel = false ;
                bton_shift.LookAndFeel.SkinName = "Money Twins";
                bton_shift.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
            }
        }

        private void bton_clr_Click(object sender, EventArgs e)
        {
            str_uni = "";
            txt_ketqua.Text = str_uni;
        }
        #endregion

        #region "   btn_!@#$%^^&*()_+"
        private void bton_cam_Click(object sender, EventArgs e)
        {
            str_uni += bton_cam.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_acong_Click(object sender, EventArgs e)
        {
            str_uni += bton_acong.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_tiente_Click(object sender, EventArgs e)
        {
            str_uni += bton_tiente.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_phantram_Click(object sender, EventArgs e)
        {
            str_uni += bton_phantram.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_va_Click(object sender, EventArgs e)
        {
            str_uni +=  bton_va.Text.Substring(0,1);
            txt_ketqua.Text = str_uni;
        }

        private void bton_gachduoi_Click(object sender, EventArgs e)
        {
            str_uni += bton_gachduoi.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_tru_Click(object sender, EventArgs e)
        {
            str_uni += bton_tru.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_chia_Click(object sender, EventArgs e)
        {
            str_uni += bton_chia.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_nhan_Click(object sender, EventArgs e)
        {
            str_uni += bton_nhan.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_ngoacmo_Click(object sender, EventArgs e)
        {
            str_uni += bton_ngoacmo.Text;
            txt_ketqua.Text = str_uni;
        }

        private void bton_ngoacdong_Click(object sender, EventArgs e)
        {
            str_uni += bton_ngoacdong.Text;
            txt_ketqua.Text = str_uni;
        }
        private void bton_dauphay_Click(object sender, EventArgs e)
        {
            str_uni += bton_dauphay.Text;
            txt_ketqua.Text = str_uni;
        }
        private void bton_phaytren_Click(object sender, EventArgs e)
        {
            str_uni += bton_phaytren.Text;
            txt_ketqua.Text = str_uni;
        }
        private void bton_phaykep_Click(object sender, EventArgs e)
        {
            str_uni += bton_phaykep.Text;
            txt_ketqua.Text = str_uni;
        }

        #endregion

        public string ShowForm(string _note, int x, int y, Boolean PassWordChar)
        {
            if (PassWordChar)
                txt_ketqua.Properties.PasswordChar = '*';
            str_uni = _note;
            Variable.str_position_frmchu = str_uni;
            Variable.pont_x = x;
            Variable.pont_y = y;
            this.ShowDialog();
            return txt_ketqua.Text.Trim();
        }
        public string ShowForm(string _TieuDe,string _note, int x, int y, Boolean PassWordChar)
        {
            this.Text = _TieuDe;
            if (PassWordChar)
                txt_ketqua.Properties.PasswordChar = '*';
            str_uni = _note;
            Variable.str_position_frmchu = str_uni;
            Variable.pont_x = x;
            Variable.pont_y = y;
            this.ShowDialog();
            return txt_ketqua.Text.Trim();
        }

        

       

       

    }
}